#ifndef __dig_ENCODE_H_H_
#define	__dig_ENCODE_H_H_

#include "stdint.h"

#ifdef	__cplusplus
extern "C" {
#endif

	typedef struct
	{
		uint8_t sample_time_cnt;
		uint8_t idle_time_cnt;

		int8_t in_flt;
		int8_t in_st;

		uint8_t bit_cnt;
		uint8_t bit_sv;
		uint8_t b_rx_ne;

		uint8_t snd_st;
		uint8_t rcv_st;

		uint8_t rcv_allow;
		uint8_t tx_allow;

		uint32_t rx_shift;
		uint32_t rx;
		uint32_t tx;

		void(*tx_out)(uint8_t st);
		uint8_t(*rx_in)(void);
		void(*io_dir)(uint8_t dir); 
	} dig_encode_type;

	void dig_encode_handle(dig_encode_type *obj);
	uint32_t dig_encode_read(dig_encode_type *obj);
	void dig_encode_write(dig_encode_type *obj, uint32_t dat);

#ifdef	__cplusplus
}
#endif

#endif	

